package Program;

import java.util.Random;
import java.util.Scanner;

public class Case3
{
    //抢红包
    public static void main(String[] args)
    {
        int[] moneys = {9,100,200,666,8888};
        Random r = new Random();
        for(int i = 0; i < 5; i++)
        {
            Scanner sc = new Scanner(System.in);
            System.out.println("随意输入进行抽奖");
            sc.next();//随意输入
            //抽出一个红包后需要保证该红包不会再出现
            while (true) {
                int index = r.nextInt(moneys.length);
                int money = moneys[index];
                if(money != 0)
                {
                    System.out.println("恭喜你抽到了" + (money) + "元");
                    moneys[index] = 0;
                    break;
                }
            }

        }

    }
}
